import { queryModel } from "../service/model/model";

/* 通用请求 */
export const queryApi = {
  queryModel: async (mode: "labelValue" | "raw", type: "lcd" | "all" | "esl" = "all") => {
    const { data } = await queryModel(type);
    if (mode === "labelValue") {
      return data.map((e: any) => {
        return {
          label: e.description,
          value: e.id
        };
      });
    }
    return data;
  }
};
